
#include "common.hpp"

int main()
{
    
    key_t key = ftok(pathname, proj_id);
    int shmid = shmget(key, 4096, IPC_CREAT);
    if (shmid == -1)
    {
        perror("shmget");
        exit(1);
    }
    // 关联起来
    char *shmaddr = (char *)shmat(shmid, nullptr, 0);
    

    // 进行通信
    while(true)
    {
        std::cout << "Please Enter:";
        std::cin >> shmaddr;
    }


    // 释放关联
    int ret = shmdt(shmaddr);
    if(ret == -1)
    {
        perror("shmdt");
        exit(3);
    }


    return 0;
}